<include file="../header" />
<div id="left-sider"><include file="../left-sider" /></div>
<style type="text/css">
textarea {width:100%;}
#content {height: 500px;}
#summary {height: 200px;}
#submit {height: 3em; width: 6em;}
#title {width: 99%; padding: .3em .5%; font-size: 1.2em;}
</style>
<div id="main">
  <div class="main-hd">
    <h2>Create a Blog</h2>
  </div>
  <div class="main-bd">
  <form action="do_create" method="post" target="_self"  class="new-form">
    <p><input type="text" name="title" id="title" required placeholder="标题"/></p>
    <p><textarea name="content" id="content">在这里输入正文…</textarea></p>
    <table width="100%" border="0">
        <tr>
            <td>
                封面:<input id="cover" name="cover" type="text" value="default.jpg" readonly="readonly" required="required"/>
                <input id="addCover" type="button" value="上传" />
            </td>
            <td>
                <label for="author">作者:</label><input id="author" name="author" type="text" placeholder="Edwiny" required="required"/>
            </td>
            <td>
                <label for="createtime">日期:</label>
                <input type="date" name="createtime" id="createtime" value="{:date('Y-m-d')}" readonly="readonly"/>
            </td>
            <td>
                <label for="lang">语言:</label>
                <select name="lang" id="lang">
                  <option value="zh-cn">简体中文</option>
                  <option value="en-us" selected="selected">English</option>
                </select>
            </td>
        </tr>
    </table>
	<p class="help">封面会显示在文章列表上，大小在200*200左右。</p>
    <p class="text-center">
      <input id="submit" type="submit" value="添加" />
    </p>
  </form>
</div>
<include file="../footer" />

<import type="js" file="js.jquery"/>
<import type="js" file="js.xheditor"/>
<script type="text/javascript">
$('#content').xheditor({tools:'Cut,Copy,Paste,Pastetext,|,SelectAll,Removeformat,|,Blocktag,Fontface,FontSize,FontColor,BackColor,|,Bold,Italic,Underline,|,Align,List,Outdent,Indent,|,Link,Unlink,Img,|,Source,Fullscreen',upImgUrl:"/admin.php/Upload/ajax_pic",upImgExt:"jpg,jpeg,gif,png",html5Upload:false,upLinkUrl:'../Upload/ajax_doc',upLinkExt:'zip,rar,7z,txt,doc,xls,ppt,pdf,docx,xlsx,pptx,psd'});

document.getElementById('addCover').addEventListener('click',function(){
	window.open("{:U('Upload/cover')}");
}, false);
</script>